import { defineStore } from 'pinia'

interface T_CameraGather_Config {
    cameraIp?: string;
    isRecording: boolean; // 录像中
    timmer: null | number, // 计时器
}

interface T_CameraGather_Config_2 {
    currentCameraIP: string;
    recordStatus: Map<string, T_CameraGather_Config>,
}

const cameraGatherConfigStore = defineStore('cameraGatherConfig', {
    state (): T_CameraGather_Config_2 {
        return {
            currentCameraIP: '',
            recordStatus: new Map(),
        }
    },
    getters: {

    },
    actions: {
        addToMap(key: string, value: T_CameraGather_Config) {
            this.recordStatus.set(key, value)
        },
        removeFromMap(key: string) {
            this.recordStatus.delete(key)
        },
    },
})

export const cameraGatherConfig = cameraGatherConfigStore